typescript 的動態新增物件屬性


今天遇到一個問題,有一個物件會依據收到的資料去新增屬性,可以利用這段語法達到想要的效果。

interface Dividend {
    [key: string]: DividendState[]
}
#nodejs #node.js #js #ts #TypeScript






你可能感興趣的文章

VSCode 中使用typescript檢視output - Code Runner套件

VSCode 中使用typescript檢視output - Code Runner套件

畫frequency response和phase response(MATLAB))

畫frequency response和phase response(MATLAB))

[C#] 檢查 Sql Injection 非法字元

[C#] 檢查 Sql Injection 非法字元






留言討論